home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
wtj007.zip
/
BLOOM.ZIP
/
PAINTBM.C
< prev
next >
Wrap
Text File
|
1992-07-24
|
640b
|
27 lines
// sample function
BOOL PaintBitmap (HWND hCtrl,HBITMAP hBM)
{
HDC hDCBits, hDC;
BITMAP bm;
BOOL ok;
RECT rect;
WORD controlID;
controlID = GetWindowWord(hCtrl, GWW_ID);
GetClientRect(hCtrl, &rect);
UpdateWindow(hCtrl);
hDC = GetDC(hCtrl);
GetClientRect(hCtrl,&rect);
hDCBits = CreateCompatibleDC(hDC);
GetObject(hBM, sizeof(BITMAP), (LPSTR)&bm);
SelectObject(hDCBits, hBM);
ok = StretchBlt(hDC, 0, 0, rect.right,
rect.bottom, hDCBits, 0, 0, bm.bmWidth,
bm.bmHeight, SRCCOPY);
DeleteDC(hDCBits);
ReleaseDC(hCtrl, hDC);
return(ok);
}